package org.springblade.modules.repair.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.mp.support.Query;
import org.springblade.modules.repair.entity.MaintainPartsWork;
import org.springblade.modules.repair.vo.*;

import java.util.List;
import java.util.Map;

public interface MaintainPartsWorkMapper extends BaseMapper<MaintainPartsWork> {

    PartsWorkDetailVO selectPartsWorkDetail(@Param("planId") Long planId);

	List<ElevatorMalfunctionPartsVO> selectPartsPlanList(@Param("pageQuery") PartsWorksPageQuery pageQuery, IPage<ElevatorMalfunctionPartsVO> page);

	/**
	 * 根据流程实例id查询申请配件工单基本信息
	 * @param processInstanceId
	 * @return
	 */
	PartsSimpleInfoVO getPartsSimpleInfo(@Param("processInstanceId") String processInstanceId);

	/**
	 * 根据工单id查询申请配件工单基本信息
	 * @param planId
	 * @return
	 */
	PartsSimpleInfoVO getPartsSimpleInfoByPlanId(@Param("planId") Long planId);

	List<ElevatorMalfunctionPartsVO> selectPartsPlanListLow(@Param("pageQuery") PartsWorksPageQuery pageQuery, IPage<ElevatorMalfunctionPartsVO> page);

	/**
	 * 根据维修配件记录的id 获取配件工单
	 * @param ids    维修配件记录的id
	 * @return 数据集
	 */
    List<MaintainPartsWork> getMaintainPartsWorkListOfMalId(@Param("ids") List<Long> ids);

	/**
	 * 配件申请分页
	 * @param param
	 * @param page
	 * @return
	 */
    List<PartsApplyDetailVO> partsApplyPage(Map<String, Object> param, IPage<PartsApplyDetailVO> page);

	List<MaintainPartsWork> selectListByPlan(Long planId);
}
